class PropertyEnumGroup < ActiveRecord::Base
  set_table_name :property_enumerable_groups

  after_initialize :build_enum_value
  
  has_many :property_enumerables
  has_many :property_enum_values

  accepts_nested_attributes_for :property_enum_values, :allow_destroy => true

  def build_enum_value
    !self.property_enum_values.blank? || 2.times {self.property_enum_values.build}
  end
end